﻿@using DealKhuyenMaiV2.com.Models

<script type="text/javascript">

    $(function () {

        $('.neoslideshow img:gt(0)').hide();
        
        setInterval(function () {
            $('.neoslideshow :first-child').fadeOut()
                 .next('img').fadeIn()
                 .end().appendTo('.neoslideshow');
        }, 4000);

    })

</script>
<style type="text/css">
    .neoslideshow
    {
        position: relative;
        width: 500px;
        height: 260px;
    }
    .neoslideshow img
    {
        position: absolute;
        left: 0;
        top: 0;
    }
    
    
</style>
<div class="neoslideshow">
    @{
        List<Image> lstImages = new List<Image>();
        lstImages = (List<Image>)ViewBag.Images;
        if (lstImages.Count > 1)
        {
            foreach (var image in lstImages)
            {
                <img src="@(image.Path)" width="460" height="320" />
            }
        }
        else
        if(lstImages.Count > 0)
        {
            <img src="@(lstImages[0].Path)" width="460" height="320" />
            <img src="@(lstImages[0].Path)" width="460" height="320" />
        }
        else
        {
            <img src="@("../../Content/Images/no-images.png")" width="460" height="320" />
            <img src="@("../../Content/Images/no-images.png")" width="460" height="320" />
        }
    }
    
</div>
